<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

    <title>微光协同办公平台-会议列表</title>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/css/plugins/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.css}" rel="stylesheet"/>

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-6">               
                    <div class="ibox-content">
                        <form class="form-horizontal m-t" id="commentForm" action="/editMachine" method="post">
                        	 <div class="form-group">
                                <label class="col-sm-3 control-label">使用者：</label>
                                <div class="col-sm-8">
                                    <input id="mUser" name="mUser" minlength="2" type="text" class="form-control" required="" aria-required="true"
                                           th:value="${mUser}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-8">
                                    <input id="mId" name="mId" minlength="2" type="hidden" class="form-control" required="" aria-required="true"
                                           th:value="${mId}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">使用条件：</label>
                                <div class="col-sm-8">
                                    <input id="mCondition" name="mCondition" minlength="2" type="text" class="form-control" required="" aria-required="true"
                                           th:value="${mCondition}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">场景：</label>
                                <div class="col-sm-8">
                                    <input id="mScene" type="mScene" class="form-control" name="text" required="" aria-required="true"
                                    th:value="${mScene}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">描述：</label>
                                <div class="col-sm-8">
                                    <input id="mDescription" type="text" class="form-control" name="mDescription"
                                    th:value="${mDescription}"/>
                                </div>	
                            </div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-3">
                                    <button class="btn btn-primary" type="button" id="editBtn">修改</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>    
        </div>

    </div>

    <!-- 全局js -->
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>

    <!-- 自定义js -->
    <script th:src="@{/js/content.js}"></script>

    <!-- Bootstrap table -->
    <script th:src="@{/js/plugins/bootstrap-table/bootstrap-table.min.js}"></script>
    <script th:src="@{/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js}"></script>
    <script th:src="@{/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>

    <!--layer-->
    <script th:src="@{/js/plugins/layer/layer.min.js}"></script>
    <script th:src="@{/js/jquery.form.js}"></script>
    <script>
        $(function () {
            $("#editBtn").on("click",function () {
                var a=$("#mUser").val();
                if(a==""){
                    layer.msg("使用者不能为空");
                    return;
                }
                var b=$("#mCondtion").val();
                if(b==""){
                    layer.msg("使用条件不能为空");
                    return;
                }
                var c=$("#mScene").val();
                if(c==""){
                    layer.msg("使用场景不能为空");
                    return;
                }
                $("#commentForm").ajaxSubmit({
                    success:function (data) {
                        if(data=="成功"){
                            layer.msg("修改"+data);
                            setTimeout(function (){
                                parent.location.reload();
                                var index=parent.layer.getFrameIndex(window.name);
                                parent.close(index);
                            },1000)
                        }else {
                            layer.msg("修改"+data);
                        }
                    }
                })
            })
        });
    </script>

</body>

</html>
